<template>
  <div class="header">
    <div class="header-left iconfont icon-fanhui"></div>
    <div class="header-input">&nbsp;输入城市/景点/游玩主题</div>
    <router-link to="/city" tag="div" class="header-right">
      {{ this.city}}
      <span class="iconfont icon-jiantou use-icon"></span>
    </router-link>
  </div>
</template>

<script>
import {mapGetters} from 'vuex'
export default {
  name: 'Header',
  data () {
    return {

    }
  },
  computed: {
    // vuex 自带的 getters 映射
    ...mapGetters({
      city: 'getCityName'
    })
  }
}
</script>

<style lang="stylus" scoped>
  @import '~styles/varibles.styl'
  .header
    color: #ffffff
    display flex
    line-height: .86rem
    background-color: $useBack
    .header-left
      width: .64rem
      float: left
      text-align center
      font-size 16px
    .header-input
      height: .64rem
      margin-top: .12rem
      margin-left: .2rem
      flex 1
      background-color: #fff
      border-radius .1rem
      line-height:.64rem
      color: #ccc
    .header-right
      padding: 0 .1rem
      min-width: 1.04rem
      float: right
      text-align center
      .use-icon
        font-size .24rem
</style>
